import socket
import time
import random

def makeint(num) :
	strs = ''
	strs += chr(num%256)
	num /= 256
	strs += chr(num%256)
	num /= 256
	strs += chr(num%256)
	num /= 256
	strs += chr(num%256)
	return strs

if __name__ == '__main__' :
	sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
	sock.connect(('localhost', 31000))

	time.sleep(1)

	strs = ''
	strs += makeint(22)
	strs += makeint(1002)
	strs += chr(6)
	strs += 'weiwei'
	strs += chr(6)
	strs += 'weiwei'
	print strs
	sock.send(strs)
